﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AtomicTypes;
using NDimArrayNamespace;

namespace Memory_Access
{
    public class QFloat64Array : QLabValues.AtomicTypeArray<AtomicTypes.QFloat64>
    {
        public QFloat64Array(params int[] dimensionSize)
            : base(dimensionSize)
        {
        }
        public QFloat64Array(QFloat64[] data, params int[] dimensionSize)
            : base(data, dimensionSize)
        {
        }

        //Darko dodao
        public QFloat64Array(QBooleanArray qba)
        {
            QFloat64[] els = new QFloat64[qba.Data.Count()];
            for (int i = 0; i < qba.Data.Count(); i++)
                els[i] = new QFloat64(qba.Data[i]);
            this.Data = (QFloat64[])els.Clone();
            this.DimensionSize = (int[])qba.DimensionSize.Clone();
        }

        //Darko dodao
        public QFloat64Array(QCharArray qca)
        {
            QFloat64[] els = new QFloat64[qca.Data.Count()];
            for (int i = 0; i < qca.Data.Count(); i++)
                els[i] = new QFloat64(qca.Data[i]);
            this.Data = (QFloat64[])els.Clone();
            this.DimensionSize = (int[])qca.DimensionSize.Clone();
        }

        //Darko dodao
        public QFloat64Array(QUInt64Array qia)
        {
            QFloat64[] els = new QFloat64[qia.Data.Count()];
            for (int i = 0; i < qia.Data.Count(); i++)
                els[i] = new QFloat64(qia.Data[i]);
            this.Data = (QFloat64[])els.Clone();
            this.DimensionSize = (int[])qia.DimensionSize.Clone();
        }

        //Darko dodao
        public QFloat64Array(QInt64Array qia)
        {
            QFloat64[] els = new QFloat64[qia.Data.Count()];
            for (int i = 0; i < qia.Data.Count(); i++)
                els[i] = new QFloat64(qia.Data[i]);
            this.Data = (QFloat64[])els.Clone();
            this.DimensionSize = (int[])qia.DimensionSize.Clone();
        }

        //Darko dodao
        public QFloat64Array(QFloat64Array qfa)
            :base(qfa.Data, qfa.DimensionSize)
        {
        }


        public int[] ToIntArray()
        {
            // TODO: konvertovanje NDimArraya u niz intidzera (npr a11,a21,a31,a12,a22,a32,a13,a23,a33)
            return null;
        }

        public QFloat64Array GetSubArray(int[][] subNDimArrayCoordinates)
        {
            NDimArray<QFloat64> tempArray = base.GetSubNDimArray(subNDimArrayCoordinates);
            return new QFloat64Array(tempArray.Data, tempArray.DimensionSize);
        }

        public override QLabValues.IQLabValueType getEnumType()
        {
            return QLabValues.IQLabValueType.QFloat64Array;
        }
    }
}
